/*
 *
 * https://zhuanlan.zhihu.com/p/514469654
 *
 * gcc -o example1 example1.c ../src/log.c
 *
 */

#include "../src/log.h"

int main(int argc, char *argv[])
{
    log_set_level(0);
    log_set_quiet(0);

    FILE *fp1, *fp2;
    fp1 = fopen("./log_info.txt", "ab");
    if(fp1 == NULL)
        return -1;

    fp2 = fopen("./log_debug.txt", "ab");
    if(fp2 == NULL)
        return -1;

    log_add_fp(fp1, LOG_INFO);
    log_add_fp(fp2, LOG_DEBUG);

    log_debug("debug");
    log_info("info");
    log_warn("warn");

    fclose(fp2);
    fclose(fp1);
    return 0;
}
